package com.hbxx.lotteryapp.controller;


import com.hbxx.lotteryapp.commons.ApiIdempotent;
import com.hbxx.lotteryapp.commons.Result;
import com.hbxx.lotteryapp.service.IOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Tonny
 * @since 2022-06-08
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private IOrderService orderService;

    /**
     * 订单分页查询
     * @param pageNum
     * @param pageSize
     * @param request
     * @return
     */
    @ApiIdempotent
    @GetMapping("/pageList")
    public Result pageList(Integer pageNum, Integer pageSize, HttpServletRequest request){
        return orderService.pageList(pageNum,pageSize,request);
    }

    @ApiIdempotent
    @GetMapping("/detail")
    public Result detail(String orderCode){
        return  orderService.detail(orderCode);
    }

}

